import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/login',
    children:[
      {path: '/admin', component: () => import('../views/admin/Admin.vue')},
      {path: '/doctorAdmin', component: () => import('../views/admin/DoctorAdmin.vue')},
      {path: '/historyAdmin', component: () => import('../views/admin/HistoryAdmin.vue')},
      {path: '/patientAdmin', component: () => import('../views/admin/PatientAdmin.vue')},
      {path: '/registeredAdmin', component: () => import('../views/admin/RegisteredAdmin.vue')},
      {path: '/medicalTreatment', component: () => import('../views/doctor/MedicalTreatment.vue')},
      {path: '/medicalHistory', component: () => import('../views/history/MedicalHistory.vue')},
      {path: '/medicine', component: () => import('../views/medicine/Medicine.vue')},
      {path: '/medicineOption', component: () => import('../views/medicine/MedicineOption.vue')},
      {path: '/patientInquiries', component: () => import('../views/patient/PatientInquiries.vue')},
      {path: '/registered', component: () => import('../views/patient/Registered.vue')},
      {path: '/schedules', component: () => import('../views/work/schedulesView.vue')},
      {path: '/application', component: () => import('../views/work/applicationView.vue')},

    ]
  },
  {path:'/login', component: () => import('../views/LoginRegistered.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
